﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NoticeBoardProperty.ascx.cs" Inherits="NLUNZ.UserControls.NoticeBoardProperty" %>
<style type="text/css">
    .editBox {
        margin: 2px 5px;
        width: 100%;
        height: 40px;
    }
    .nbView {
        padding-left: 20px;
        padding-top: 8px;
        padding-bottom: 8px;
        padding-right: 20px;
     }
</style>

<div class="insertNoticeBoard" runat="server">
    <div style="font-weight: bold;">添加通知</div>
    <div>
        <asp:TextBox ID="txtNB" runat="server" TextMode="MultiLine" Height="58px" 
            Width="801px"></asp:TextBox>
    </div>
    <div>
        <asp:Button runat="server" ID="btnAddNB" Text="提交" onclick="btnAddNB_Click"/>
    </div>
</div>
<div class="editNoticeBoards" runat="server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="ID" 
        DataSourceID="LinqDataSource1"  ShowHeader="False"
        EnableModelValidation="True" CellPadding="4" ForeColor="#333333" 
        GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" DeleteText="删除" 
                EditText="修改" CancelText="取消" UpdateText="更新" />
            <asp:TemplateField HeaderText="Title" SortExpression="Title">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="60px" CssClass="editBox" Text='<%# Bind("Title") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate><div style="padding:5px 10px;">
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Title") %>'></asp:Label></div>
                </ItemTemplate>
                <ItemStyle Width="650px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="CreateDate" SortExpression="CreateDate">
                <EditItemTemplate>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" 
                        Text='<%# Bind("CreateDate", "{0:yyyy-MM-dd}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" 
        ContextTypeName="NLUNZ.Business.NLUDBDataContext" TableName="NoticeBoards" 
        runat="server" EnableDelete="True" EnableInsert="True" EnableUpdate="True" 
        OrderBy="CreateDate desc">
    </asp:LinqDataSource>
</div>